# Copyright 1999-2006 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License, v2 or later
# $Header:$
# Nonofficial ebuild by Ycarus. For new version look here : http://gentoo.zugaina.org/

MY_PN="PeerTV"
MY_PV="033"
DESCRIPTION="Program to watch WebTV"
HOMEPAGE="http://www.peertv.fr/"
LICENSE="artistic"
SRC_URI="http://www.kloxigrues.com/installer/${MY_PN}-${MY_PV}-Linux-061119.tar.gz"
RESTRICT="nomirror"
IUSE=""
KEYWORDS="~x86 ~amd64"

DEPEND="dev-perl/perl-tk
	dev-perl/libwww-perl
	dev-perl/XML-Simple
	x86? ( media-video/mplayer )
	amd64? ( media-video/mplayer-bin )
	dev-lang/perl
	"
	
	
RDEPEND="$DEPEND"


S=${WORKDIR}/${MY_PN}-${MY_PV}-Linux

src_install () {
    rm -r test
    dodir /usr/share/peertv
    cp -r * ${D}/usr/share/peertv
    fperms 755 PeerTV.pl /usr/share/peertv
    fperms 777 *.xml /usr/share/peertv
    cat << EOF > "PeerTV"
#!/bin/sh
cd "/usr/share/peertv"
./PeerTV.pl
EOF
    chmod go+rx PeerTV
    exeinto /usr/bin
    doexe PeerTV
}
